package com.framework.loippi.plugins.aliapppay.reFund;

import com.framework.loippi.cache.ConfigCache;
import com.framework.loippi.plugins.aliapppay.reFund.entity.AliPayRefund;
import com.framework.loippi.plugins.aliapppay.reFund.entity.AlipaySubmit;

import java.math.BigDecimal;

public class AlipayRefundUtil {


    /**
     * 支付宝退款
     *
     * @param aliPayRefund
     * @return
     */
    public static String toRefund(AliPayRefund aliPayRefund) {
        //建立请求
        String sHtmlText = AlipaySubmit.buildRequest(aliPayRefund.getTradeNo(), aliPayRefund.getRefundAmount(),
                aliPayRefund.getRRefundReason(), ConfigCache.getConfig("alipay.appId"), ConfigCache.getConfig("alipay.privateKey"), ConfigCache.getConfig("alipay.publicKey"));
        return sHtmlText;
    }

}
